import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:search_people/page/home/main/logic.dart';
import 'package:search_people/page/home/main/views/dynamic_cell.dart';
import 'package:search_people/page/home/subs/person_detail/models/person_dynamic_model.dart';
import 'package:search_people/value/topcolors.dart';

class HotDynamicWidget extends GetView<HomeLogic> {
  const HotDynamicWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var dynamics = controller.state.dynamics;
    return GetBuilder<HomeLogic>(
        builder: (ctr) => Container(
              color: Colors.white,
              child: ListView.separated(
                  physics: const NeverScrollableScrollPhysics(),
                  itemBuilder: (context, index) {
                    var md = dynamics[index];
                    return DynamicCell(
                      md: md,
                    );
                  },
                  separatorBuilder: (ctx, index) {
                    return Container(
                      color: TopColors.bg,
                      height: 1,
                    );
                  },
                  itemCount: dynamics.length),
            ));
  }
}
